<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./vue.js"></script>
</head>
<body>
    <div id="app">
        <!-- 1、一般情况下，复选框也会当作单选框使用例如确认协议等 ，修改会改变布尔值-->
        <input type="checkbox" name="agree" v-model="isAgree">你是否同意该协议

        <!-- 2、多个复选框 ,保存值为一个数组，value为选择的值-->
        <input type="checkbox" name="food" v-model="likeFood" value="苹果">苹果
        <input type="checkbox" name="food" v-model="likeFood" value="香蕉">香蕉
        <input type="checkbox" name="food" v-model="likeFood" value="橙子">橙子
        <input type="checkbox" name="food" v-model="likeFood" value="葡萄">葡萄
    </div>

    <script>
        Vue.config.productionTip = false;
        const vm = new Vue({
            el:'#app',
            data(){
                return{
                    msg:'halo',
                    isAgree:true,
                    likeFood:[]
                }
            }
        })
    </script>
</body>
</html>